package com.mapper;

import com.domain.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {

    @Select("SELECT * FROM t_user WHERE id = #{id}")
    User findById(Integer id);

    @Insert("INSERT INTO t_user (user_name, pwd, email)" +
                        "values (#{userName}, #{pwd}, #{email})")
    int insertUser(User user);

//    @Update("")
//    int updateUser(User user);

    @Delete("DELETE FROM t_user WHERE id = #{id}")
    int deleteUser(Integer id);

    @Select("SELECT * FROM t_user WHERE user_name = #{userName} and pwd = #{pwd}")
    User userLogin(User user);

}
